The present invention relates to digital cameras and similar devices, and more particularly, to an improved method for converting data from a camera sensor to a color image.
A digital color image usually consists of an array of pixel values representing the intensity of the image at each point on a regular grid. Typically, three colors are used to generate the image. At each point on the grid the intensity of each of these colors is specified, thereby specifying both the intensity and color of the image at that grid point.
Conventional color photography records the relevant image data by utilizing three overlapping color sensing layers having sensitivities in different regions of the spectrum (usually red, green, and blue). Digital cameras and scanners, in contrast, typically utilize one array of sensors in a single xe2x80x9clayerxe2x80x9d.
When only one sensor array is used to detect color images, only one color may be detected at any given sensor location. As a result, these sensors do not produce a color image in the traditional sense, but rather a collection of individual color samples, which depend upon the assignment of color filters to individual sensors. This assignment is referred to as the color filter array (CFA) or the color mosaic pattern. To produce a true color image, with a full set of color samples (usually red, green and blue) at each sampling location, a substantial amount of computation is required to estimate the missing information, since only a single color was originally sensed at each location in the array. This operation is typically referred to as xe2x80x9cdemosaicingxe2x80x9d.
To generate the missing information, information from neighboring pixels in the image sensor must be used. In addition, some assumption must be utilized about the structure of the underlying image, since there are an infinite number of possible images that could have generated the measured color values. Typically, it is assumed that the underlying image is smooth, and an interpolation algorithm is then utilized to compute the missing color values from the neighboring measured color values.
While most images of interest to human observers are mainly smooth, the smoothness assumption is not satisfied along edges of objects and in textured regions of the image. In these regions, images generated by interpolation using the smoothness assumption show a loss of resolution. In addition, algorithms that treat the red sensors as being independent from the green sensors, and so on, typically generate color artifacts in the reconstructed images. The artifacts are incorporated in the chrominance part of the image and are due to mis-registration of the chrominance components. These artifacts express themselves as streaks of false colors in the restored image, and are especially apparent around boundaries between different objects in the image and in textured areas.
Broadly, it is the object of the present invention to provide an improved image processing method for converting data from a pixel array having non-overlapping sensors to a fully sampled digital image.
It is a further object of the present invention to provide a conversion method that does not generate the color artifacts discussed above.
It is yet another object of the present invention to provide a conversion method which has improved resolution around boundaries between objects and in textured areas.
These and other objects of the present invention will become apparent to those skilled in the art from the following detailed description of the invention and the accompanying drawings.
The present invention is a method for operating a data processing system to generate a full color image from a partially sampled version of the image. The full color image includes a first two-dimensional array of vectors. Each vector in the first two-dimensional array includes first, second, and third intensity values. Each intensity value represents the intensity of a pixel in the full color image in a corresponding spectral band at a location in the full color image determined by the location of the vector in the first two-dimensional array. The method generates the first two-dimensional array from a two-dimensional array of scalars, each scalar corresponding to one of the vectors in the first two-dimensional array. The scalar determines one of the first, second, or third intensity values at a corresponding location in the two-dimensional array of vectors. The scalars are typically the measured pixel values from a sensor array in a digital camera or the like. The method of the present invention determines the remaining ones of the first, second, and third intensity values. The method starts by assigning a value to each one of the components of the vectors in the first two-dimensional array of vectors that is not determined by one of the scalars. A luminance image and first and second chrominance images are then generated from the first two-dimensional array of vectors. Each pixel in the luminance image is determined by the intensity of light from a corresponding pixel in the first two-dimensional array, and each pixel in the first and second chrominance images representing the color of the pixel in the first two-dimensional array. The first and second chrominance images are filtered with an isotropic low-pass spatial filter to generate first and second filtered chrominance images. The two-dimensional array of vectors is then regenerated from the luminance image and the first and second filtered chrominance images. The decomposition, filtering, and regenerating steps are iterated to provide the final full-color image. At each iteration, the components of the two-dimensional array of vectors that were actually measured are reset to their measured values. In the preferred embodiment of the present invention, the luminance image is also filtered. However, the filtering of the luminance image utilizes a low-pass spatial filter having an anisotropy that varies with location in the luminance image. The regeneration step is then performed with the filtered luminance image. In the preferred embodiment of the present invention, the filtering of the luminance image is performed by first decomposing the luminance image into a plurality of component images, each component image representing information in the luminance image at different levels of scale. Each component image is then filtered with a low-pass spatial filter having an anisotropy that varies with location in the component image. The filtered component images are then recombined to generate the filtered luminance image.